#ifndef IO_H
#define IO_H

#include <QIODevice>
#include <QObject>
#include <functional>

class IO : public QObject
{
    Q_OBJECT
public:
    explicit IO(QObject *parent = nullptr);

    static qint64 copy(QString srcName, QIODevice& src, QString dstName, QIODevice& dst, qint64 maxCopy = -1, std::function<void (qint64, qint64)> progress = nullptr);
    static qint64 copy(QString srcName, QByteArray& src, QString dstName, QIODevice& dst, qint64 maxCopy = -1, std::function<void (qint64, qint64)> progress = nullptr);
    static qint64 copy(QString srcName, QIODevice& src, QString dstName, QByteArray& dst, qint64 maxCopy = -1, std::function<void (qint64, qint64)> progress = nullptr);
    static qint64 copy(QString srcName, QIODevice& src, QString dstName, char* dstBuff, qint64 dstOffset, qint64 dstLen, qint64& nCopy, std::function<void (qint64, qint64)> progress = nullptr);
    static qint64 copy(QString srcName, char* srcBuff, qint64 srcOffset, qint64 srcLen, QString dstName, QIODevice& dst, std::function<void (qint64, qint64)> progress = nullptr);
    static qint64 session(QIODevice& device, QIODevice::OpenModeFlag flags, std::function<int (QIODevice& device)> callback);
    static qint64 session(QIODevice& in, QIODevice& out, std::function<int (QIODevice& in, QIODevice& out)> callback);

signals:

public slots:
};

#endif // IO_H
